package Cn.Sarkar.MMS.Entities.Independent.Wallet

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Wallet.ChangeHistorys
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.MMS.Entities.Independent.Account
import Cn.Sarkar.Entities.MMS.Independent.IAccount
import Cn.Sarkar.Entities.MMS.Independent.Wallet.IChangeHistory
import Cn.Sarkar.Entities.MMS.Independent.Wallet.IMemberShipLevel
import Cn.Sarkar.Entities.MMS.Independent.Wallet.IWallet
import org.joda.time.DateTime

class ChangeHistory(DataContext: IDataContext) : BaseEntity(DataContext, ChangeHistorys), IChangeHistory {
    var accountID by ChangeHistorys.AccountID
    override var account: IAccount by hasOne(ChangeHistorys.AccountID) { Account(it) }
    var walletID by ChangeHistorys.WalletID
    override var wallet: IWallet by hasOne(ChangeHistorys.WalletID) { Wallet(it) }
    var operatorID by ChangeHistorys.OperatorID
    override var operator: IAccount by hasOne(ChangeHistorys.OperatorID) { Account(it) }
    override var integral: Float by ChangeHistorys.Integral
    override var money: Float by ChangeHistorys.Money
    var memberShipLevelID by ChangeHistorys.MemberShipLevelID
    override var memberShipLevel: IMemberShipLevel by hasOne(ChangeHistorys.MemberShipLevelID) { MemberShipLevel(it) }
    override var toNowTotalIntegralCount: Float by ChangeHistorys.ToNowTotalIntegralCount
    override var toNowTotalMoney: Float by ChangeHistorys.ToNowTotalMoney
    override var toNowUseCount: Int by ChangeHistorys.ToNowUseCount
    override var description: String by ChangeHistorys.Description
    override var icCardID: String by ChangeHistorys.ICCardID
    override var magnetCardID: String by ChangeHistorys.MagnetCardID
    override var rFIDCardID: String by ChangeHistorys.RFIDCardID
    override var dateTime: DateTime by ChangeHistorys.DateTime
}